<!doctype html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <link rel="stylesheet" href="/static/css/my/common.css"/>
    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script src="/static/js/xadmin.js" type="text/javascript"></script>
</head>
<body>
<form class="layui-form" method="post" target="_parent" action="/staff/staffManagerAddController">
    <input name="id" value="15110312981" style="display:none">
    <div class="layui-form-item">
        <label class="layui-form-label">员工名字</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="" placeholder="请输入名字" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">个人信息</label>
        <div class="layui-input-inline">
            <input type="text" name="age" lay-verify="" placeholder="年龄" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="text" name="email" lay-verify="" placeholder="邮箱" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="text" name="wx" lay-verify="" placeholder="微信号" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="text" name="dd" lay-verify="" placeholder="钉钉号" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">职位信息</label>
        <div class="layui-input-inline">
            <input type="text" name="tel" lay-verify="" placeholder="电话" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="text" name="jobnum" lay-verify="" placeholder="工号" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="text" name="position" lay-verify="" placeholder="职位" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="text" name="level" lay-verify="" placeholder="级别" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <input type="radio" name="sex" value="0" title="男">
            <input type="radio" name="sex" value="1" title="女" checked>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所属校区</label>
        <div class="layui-input-block">
            <select id="getAreaList" name="city" lay-verify="">
                <option value="" id="getAreaList1"></option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">入职时间</label>
        <div class="layui-input-inline">
            <input type="date" name="begintime" class="layui-input" id="date">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<script>
    var use = layui.use(['form', 'jquery', 'layer', 'laydate'], function () {
        let form = layui.form
            , $ = layui.jquery;

        /*//监听提交
        form.on('submit(formDemo)', function (data) {
            layer.msg(JSON.stringify(data.field));
            return false;
        });*/
        let selectEL = $('#getAreaList');
        selectEL.empty();
        selectEL.append();
        $.post("/area/areaNameList", {tel: '15110312981'}, function (data) {
            console.log(data);
            $.each(data, function (index, area) {
                selectEL.append(new Option(area.name, area.tel));//添加
            });
            form.render('select')
        }, 'json');

    });

</script>
</body>
</html>